home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / batchut / batsec.zip / CHAPT2 < prev    next >
Text File  |  1992-03-04  |  7KB  |  193 lines

  1.  
  2.  
  3.                              CHAPTER 2
  4.  
  5.                    INTRODUCTION TO COLOR CODES
  6.                 Two Easy Steps To A World Of Color
  7.  
  8.         Having a color monitor takes advantage of the color codes
  9.         provided by the MS-DOS disk. These simple-to-learn codes
  10.         will spark life into programs that you write and provide as
  11.         many as 64 color combinations "free," just by typing a few short
  12.         color codes.
  13.         In the next sections, you will be creating color
  14.         combinations and Menus that will contain Speed Keys. When
  15.         creating these Menus you will also be adding a different color
  16.         combination to each one.
  17.       
  18.         WHAT YOU WILL LEARN IN THIS CHAPTER
  19.         Ansi Escape Codes For Color
  20.         How To Use These Codes
  21.  
  22.         HOW TO GET STARTED WITH COLOR
  23.         STEP 1.
  24.         You must copy from the MS-DOS disk a file called Ansi.Sys.
  25.         This file takes your color codes and adapts them so that your
  26.         color monitor can use them.
  27.         The next step is to store Ansi.Sys in a special file called
  28.         Config.Sys so that it will be available to DOS when the
  29.         computer is turned on.
  30.  
  31.         STEP 2.
  32.         The Ansi.Sys file must be stored in the Config.Sys file as
  33.         outlined on the next page. With this accomplished you will
  34.         have the necessary components to run the color codes and
  35.         have color appear on your color monitor.
  36.         You start by copying the Ansi.Sys file from the DOS disk
  37.         as follows:
  38.  
  39.         Insert the MS-DOS into the Computer.
  40.  
  41.         Next to the A> Prompt, type the following:
  42.  
  43.               Copy  Ansi.Sys  B:      <Press the Enter key.>
  44.  
  45.         Follow the DOS prompts. Insert your disk when requested.
  46.         A copy of the Ansi.Sys file from MS-DOS disk will be transferred
  47.         to your disk.
  48.  
  49.         One More Step
  50.         Leave your disk in the computer.
  51.  
  52.         In this next step, you are going to create a Config.Sys file
  53.         in which you will put your Ansi.Sys command.
  54.         To do this: type the following next to the A> Prompt, like this:
  55.  
  56.                 Copy  Con  Config.Sys
  57.                 Device=Ansi.Sys
  58.                 F6        <Press Enter key to end the file.>
  59.           ------------
  60.         That's all there's to it!
  61.         You now have the two files you need to get color.
  62.                              -6-
  63.  
  64.  
  65.  
  66.  
  67.  
  68.         The ANSI Color Escape Sequences
  69.         The word ANSI stands for the "American National
  70.         Standards Institute"  which developed these codes.
  71.         Below is a copy of the color Escape codes for setting
  72.         color to the background and letters.
  73.  
  74.         These codes are called the ANSI Escape Codes,
  75.         or Sequences for setting the foreground
  76.         (letters or text) and background colors. Type as indicated.
  77.         Don't use capital letters for the code.The Escape Code
  78.         always starts:
  79.         With a Dollar Sign ($)
  80.         A Small (e)
  81.         A Left Bracket ([ )
  82.         And ends with the small letter (m)
  83.    
  84.         All of the above parameters are used on the next page.
  85.  
  86.         SPECIAL ATTRIBUTE COMMANDS
  87.         $e[0m  Normal, white on black
  88.         $e[1m  Bold, high intensity
  89.         $e[4m  Underline if available
  90.         $e[5m  Blink
  91.         $e[7m  Reverse video
  92.  
  93.         These five commands are called attribute commands.
  94.         They let you control the brightness, blinking and reverse video.
  95.  
  96.  
  97.         THE COLOR CODES
  98.         $e[30m  black letters      $e[40m  black background
  99.         $e[31m  red letters        $e[41m  red background
  100.         $e[32m  green letters      $e[42m  green background
  101.         $e[33m  yellow letters     $e[43m yellow background
  102.         $e[34m  blue letters       $e[44m  blue background
  103.         $e[35m  magenta letters    $e[45m magenta background
  104.         $e[36m  cyan letters       $e[46m  cyan background
  105.         $e[37m  white letters      $e[47m  white background
  106.                   
  107.         The group of Ansi codes list 8 colors for the letters
  108.         and 8 colors for the background. Simple math shows
  109.         that 8 x 8 =64. Therefore, we have 64 possible
  110.         color combinations.
  111.                                                              
  112.         HOW TO USE THESE COLOR CODES
  113.         There are a few simple rules you must follow if you want the
  114.         color codes to work:
  115.         ▀  You must always start with the word "Prompt".
  116.         ▀  Then the dollar sign, as the first entry after Prompt.
  117.         ▀  Then the small e  (Yes, you can use a capital E here.)
  118.         ▀  Then the left bracket.
  119.         ▀  End with a small m.  (small m, please)
  120.         ▀  Escape sequences may be combined by putting a
  121.            semicolon after each item.
  122.  
  123.         YOUR FIRST ENTRY WILL BE TO CHANGE THE
  124.         Screen Color to Black and White.
  125.  
  126.                               -7-
  127.  
  128.  
  129.  
  130.  
  131.  
  132.         To do this, type the following next to the A> Prompt, like
  133.         this:
  134.   
  135.                 Prompt  $e[0m  $p$g
  136.                <Press the Enter key.>
  137.  
  138.         The $e[0m is the code to reverse all colors to black and
  139.         white. This is known as reverse video. Your screen will
  140.         remain black and white until you add some of your own
  141.         color or use a commercial program that has its own color
  142.         program, or restart your computer.
  143.  
  144.         You should now have your original black and white
  145.         colors on your screen. If you still have color on your screen,
  146.         recheck the way you entered the Ansi Escape codes.
  147.    
  148.         It is important that you type the codes exactly as shown.
  149.         Make certain that:
  150.  
  151.         ▀  The first word is "Prompt.                    Prompt
  152.         ▀  The second word is the dollar sign ($).       Prompt $
  153.         ▀  The third word  is the small (e).             Prompt $e
  154.         ▀  The next, the left bracket  ( [ )             Prompt $e[
  155.         ▀  Then the code number                          Prompt $e[7m
  156.         ▀  Finally,next to the code type $p$g            Prompt $e[7m $p$g
  157.                   
  158.         The $p$g gives you this subdirectory prompt A:\>.
  159.  
  160.         When you type Escape codes and can't get any color change
  161.         on the screen, you must restart (boot) your computer to
  162.         enter these new escape commands into the computer's
  163.         "memory."
  164.                           Press Esc key to return to Menu
  165.  
  166.                        GO TO CHAPTER 3  "Color Combinations"
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.                                 -8-
  193.